#include<iostream>
#include<algorithm>
#include<stack>
#include<string>
using namespace std;

int main()
{
	string s;
	cin>>s;
	stack<char>stk;
	for(int i=0;i<s.size();i++){
		if(stk.size()==0){
			stk.push(s[i]);
		}
		else{
			if(stk.top()!=s[i]){
			stk.push(s[i]);
		    }
		    else{
			stk.pop();
		    }		
		}

	}
	while(stk.size()){
		cout<<stk.top();
		stk.pop();
	}


	return 0;
 } 
